1. Field of the Invention
The invention relates to an image processing apparatus and a method of the same, and more particularly, to an image processing apparatus and a method which can adjust lightness of an input image, and then adjust saturation of the input image according to the adjusted lightness.
2. Description of the Prior Art
In current displays, all users can adjust color saturations via an on screen display (OSD) for enhancing displaying effects of images. Please refer to FIG. 1, FIG. 2A and FIG. 2B. FIG. 1 is a functional block diagram of an image processing apparatus 1 according to prior art. FIG. 2A is a schematic diagram of the look-up table of lightness gain 160a shown in FIG. 1. FIG. 2B is a schematic diagram of the look-up table of hue gain 160b shown in FIG. 1. The image processing apparatus 1 includes a first color space converter 10, a hue converter 12, a first saturation converter 14, processing units 16a and 16b, multipliers 18a and 18b, a second saturation converter 20, and a second color space converter 22. The processing unit 16a can store the lightness gain look-up table 160a, as shown in FIG. 2A, and the processing unit 16b can store the hue gain look-up table 160b, as shown in FIG. 2B.
The first color space converter 10 is used for converting an input image from RGB color space into Lab color space, wherein L stands for a lightness component, and, a and b stand for color components respectively. The hue converter 12 is used for converting the color components a and b into a hue (H) of the input image, wherein the hue (H) is defined as {dot over (H)}=tan−1(b/a). The first saturation converter 14 is used for converting the color components a and b into a saturation (S) of the input image, wherein the saturation (S) is defined as S=√{square root over (a2+b2)}.
The processing unit 16a determines a lightness gain (Gain-L) based on the lightness (L) of an input image and the look-up table of lightness gain 160a. The processing unit 16b determines a hue gain (Gain-H) based on the hue of the input image and the look-up table of hue gain 160b. Then, the multiplier 18a multiplies the lightness gain (Gain-L) by the hue gain (Gain-H) to generate a saturation gain (Gain-S). Afterward, the multiplier 18b multiplies the saturation gain (Gain-S) by the saturation of the input image to generate an adjusted saturation.
The second saturation converter 20 is used for converting the adjusted saturation into the color components a and b. Then, the second color space converter 22 converts the input image, from the second saturation converter 20, from Lab color space into RGB color space.
Please refer to FIG. 3A and FIG. 3B. FIG. 3A is a schematic diagram of Lab color space. FIG. 3B is a schematic diagram of a saturation with different lightness and hues in the Lab color space. As shown in FIG. 3A, in the Lab color space, the lightness (L) is controlled by heights, the hue (H) is controlled by angles, and the saturation (S) is controlled by radii. According to the above description, the image processing apparatus 1 of prior art uses the lightness gain (Gain-L) and the hue gain (Gain-H), respectively, to adjust the saturation of the input image. However, as shown in FIG. 3B, when the lightness of the input image is different, the saturation range of hue of the input image will be different accordingly. Because the section of the color space of each lightness is different and different hues (angles) have different saturation ranges, the lightness gain (Gain-L) is selected based on the lightness and the hue gain (Gain-H) is selected based on the hue would result in that the saturation is not easy to control and it leads to color deviations as well.
Besides, the image processing apparatus 1 of the prior art is used for adjusting saturation; therefore, users can not increase or decrease lightness according to their preference.
Accordingly, the scope of the invention is to provide an image processing apparatus and a method of the same to solve the above mentioned problems.